<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keyword" content="">

    <title>项目族库 - BIM管理</title>

    <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="__PUBLIC__/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/css/style.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style-responsive.css" rel="stylesheet" />
    <!-- new styles-->
      <link href="__PUBLIC__/css/xxxstyle.css" rel="stylesheet" />
   
      <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

  <section id="container">
      <section id="main-content">
          <section class="wrapper site-min-height">
              <!-- page start-->
              <div class="panel cReport-fill">
                  <header class="panel-heading"><i class="icon-plus-sign"></i>添加产品
                      <span class="tools pull-right">
                            <button type="button" class="btn btn-default btn-xs" onclick="javascript:window.history.back();return false;"><i class="icon-reply"></i>返回</button>
                      </span>
                  </header>         
           <form action="{:U('Family/libraryadd')}" enctype="multipart/form-data" method="post" onsubmit="return checkForm(this)">
                  <div class="panel-body fillCom">
                      <div class="form-group">
                          <label class="col-xs-2 control-label">产品名称</label>
                          <div class="col-xs-10">
                              <input type="text" class="form-control" value="{$data.name}"  name="name" required=""/>
                          </div>
                      </div>
                  </div>

                  <header class="panel-heading tab-bg-dark-navy-blue">
                      <ul class="nav nav-tabs libraryaddBlock">
                          <li class="active">
                              <a class="cursorDef"><i class="icon-th-list"></i>分类</a>
                          </li>
                      </ul>
                  </header>
                  <div class="panel-body">
                      <div class="tab-content">
                          
                              <div class="form-group-nohidden">
                                  <label class="col-xs-2 control-label">类型</label>
                                  <div class="col-xs-4">
                                      <select class="selectpicker" data-live-search="true" name="type">
                                       <foreach name="cate['type']" item="v" key="k">
                                          <option value="{$v.name}" <if condition="$data['type'] eq $v['name']">selected="selected"</if>>{$v.name}</option>
                                       </foreach>
                                      </select>
                                  </div>
                                  <label class="col-xs-2 control-label">产品系列</label>
                                  <div class="col-xs-4">
                                      <select class="selectpicker" data-live-search="true" name="series">
                                       <foreach name="cate['series']" item="s" key="k">
                                          <option value="{$s.name}" <if condition="$data['series'] eq $s['name']">selected="selected"</if>>{$s.name}</option>
                                       </foreach>
                                      </select>
                                  </div>
                              </div>
                              <div class="form-group-nohidden">
                                  <label class="col-xs-2 control-label">文件类型</label>
                                  <div class="col-xs-4">
                                      <select class="selectpicker" data-live-search="true" name="file_type">
                                       <foreach name="cate['file_type']" item="f" key="k">
                                          <option value="{$f.name}" <if condition="$data['file_type'] eq $f['name']">selected="selected"</if>>{$f.name}</option>
                                       </foreach>
                                      </select>
                                  </div>
                                  <label class="col-xs-2 control-label">品牌</label>
                                  <div class="col-xs-4">
                                      <select class="selectpicker" data-live-search="true" name="brand">
                                      <foreach name="cate['brand']" item="b" key="k">
                                          <option value="{$b.id}" <if condition="$data['brand'] eq $b['id']">selected="selected"</if>>{$b.name}</option>
                                       </foreach>
                                      </select>
                                  </div>
                              </div>
                         
                      </div>
                  </div>

                  <header class="panel-heading tab-bg-dark-navy-blue">
                      <ul class="nav nav-tabs libraryaddBlock">
                          <li class="active">
                              <a href="#libraryadd2" data-toggle="tab" class="cursorDef"><i class="icon-link"></i>链接</a>
                          </li>
                      </ul>
                  </header>
                  <div class="panel-body">
                      <div class="tab-content">
                          <div class="tab-pane active" id="libraryadd2">
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">产品网址</label>
                                  <div class="col-xs-10">
                                      <input type="text" class="form-control" value="{$data.website}" name="website" required="required"/>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">安装说明</label>
                                  <div class="col-xs-10">
                                      <input type="text" class="form-control" value="{$data.install}" name="install" required="required"/>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">产品认证</label>
                                  <div class="col-xs-10">
                                      <input type="text" class="form-control" value="{$data.authen}" name="authen" required="required"/>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">技术描述</label>
                                  <div class="col-xs-10">
                                      <input type="text" class="form-control" value="{$data.technology}" name="technology" required="required"/>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>       
                          
                  <header class="panel-heading tab-bg-dark-navy-blue">
                      <ul class="nav nav-tabs libraryaddBlock">
                          <li class="active">
                              <a href="#libraryadd3" data-toggle="tab" class="cursorDef"><i class="icon-paper-clip"></i>相关</a>
                          </li>
                      </ul>
                  </header>
                  <div class="panel-body">
                      <div class="tab-content">
                          <div class="tab-pane active" id="libraryadd3">
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">材料（主）</label>
                                  <div class="col-xs-4">
                                      <input type="text" class="form-control" value="{$data.material}" name="material" required="required"/>
                                  </div>
                                  <label class="col-xs-2 control-label">材料（次）</label>
                                  <div class="col-xs-4">
                                      <input type="text" class="form-control" value="{$data.materialc}" name="materialc" required="required"/>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">设计者</label>
                                  <div class="col-xs-4">
                                      <input type="text" class="form-control" value="{$data.designer}" name="designer" required="required"/>
                                  </div>
                                  <label class="col-xs-2 control-label">制作国</label>
                                  <div class="col-xs-4">
                                      <input type="text" class="form-control"  value="{$data.country}" name="country" required="required"/>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>        
                          
                  <header class="panel-heading tab-bg-dark-navy-blue">
                      <ul class="nav nav-tabs libraryaddBlock">
                          <li class="active">
                              <a href="#libraryadd4" data-toggle="tab" class="cursorDef"><i class="icon-cloud-upload"></i>上传</a>
                          </li>
                      </ul>
                  </header>
                  <div class="panel-body">
                      <div class="tab-content">
                          <div class="tab-pane active" id="libraryadd4">
                              	<div class="form-group">
                                  <label class="col-xs-2 control-label">上传图片</label>
                                  <div class="col-xs-4">
                                      <span class="downloadFile downloadFile1">
                                        <input type="file" name="image"/>
                                      </span>
                                      <input type="text" class="form-control" value="" id="image"  disabled="disabled"  placeholder="大小请在1M以下"/>
                                  </div>
                                  <label class="col-xs-2 control-label">上传文件</label>
                                  <div class="col-xs-4">
                                      <span class="downloadFile downloadFile2">
                                        <input type="file" name="file"/>
                                      </span>
                                      <input type="text" class="form-control" id="file"  disabled="disabled" placeholder="大小请在5M以下" />
                                  </div>
                              </div> 
                          </div>
                      </div>
                  </div>        
                         
                  <header class="panel-heading tab-bg-dark-navy-blue">
                      <ul class="nav nav-tabs libraryaddBlock">
                          <li class="active">
                              <a href="#libraryadd5" data-toggle="tab" class="cursorDef"><i class="icon-edit"></i>内容</a>
                          </li>
                      </ul>
                  </header>
                  <div class="panel-body">
                      <div class="tab-content">
                          <div class="tab-pane active" id="libraryadd5">
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">描述</label>
                                  <div class="col-xs-10">
                                      <textarea class="form-control error" rows="5" name="describe" required="">{$data.describe|json_decode}</textarea>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-xs-2 control-label">规范文本</label>
                                  <div class="col-xs-10">
                                      <textarea class="form-control error" rows="5" name="text" required="">{$data.text|json_decode}</textarea>
                                      <input type="hidden" value="{$data.id}" name="id">
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>       
        
                  <div class="cReport-btn mt15">
                      <button class="btn btn-submit" type="submit" id="tj">提交</button>
                  </div>
                 </form>
              </div>
              <!-- page end -->
          </section>
      </section>
      <!--main content end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="__PUBLIC__/js/jquery.js"></script>
    <script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
    <script src="__PUBLIC__/js/bootstrap.min.js"></script>
    <script class="include" type="text/javascript" src="__PUBLIC__/js/jquery.dcjqaccordion.2.7.js"></script>
    <script src="__PUBLIC__/js/jquery.scrollTo.min.js"></script>
    <script src="__PUBLIC__/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jquery.customSelect.min.js" ></script>

    <!--common script for all pages-->
    <script src="__PUBLIC__/js/common-scripts.js"></script>

    <!--new script for this page only-->
    <script src="__PUBLIC__/js/bootstrap-select.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
    
    <script>
    $(".downloadFile1").on("change","input[name='image']",function(){
        var filePath=$(this).val();
        if(filePath.indexOf("jpg")!=-1 || filePath.indexOf("png")!=-1){
            var arr=filePath.split('\\');
            var fileName=arr[arr.length-1];
            $("#image").attr('value',fileName);
        }else{
        	layer.alert('您未上传图片，或者您上传的图片类型有误', {icon: 2});
            return false
        }
    })
      $(".downloadFile2").on("change","input[name='file']",function(){
        var filePath=$(this).val();
        var arr=filePath.split('\\');
        var fileName=arr[arr.length-1];
        if(fileName !=''){
            $("#file").attr('value',fileName);
        }else{
        	layer.alert('您未上传文件', {icon: 2});
            return false
        }
    })
    
     //提交判断
     function checkForm(o){  
   	 	 var image = $('#image').val();
   	 	 var file = $('#file').val();
   	  	 if(image == ''){
  			  layer.alert('请选择图片', {icon: 2});
              return false
	   	 }
	   	 if(file ==''){
	   		 layer.alert('请上传文件',{icon: 2});
	   		return false
	   	 }
	   	 
	   	 $('#tj').attr('disabled',true);
		 $('#tj').text('正在提交中……');
		 layer.alert('数据正在提交中,上传文件等候时间较慢,请不要刷新单前页面,以免导致上传失败',{icon: 2});
		 return true;
     }
    </script>
    

  </body>
</html>
